const mongoose = require('mongoose');

const productSchema = new mongoose.Schema({
  status: { 
    type: String, 
    enum: ['上架中', '下架中'], 
    default: '下架中' 
  },
  name: { type: String, required: true },
  category: { type: String, required: true },
  currentStock: { type: Number, required: true, min: 0 },
  description: { type: String },
  price: { type: Number, required: true, min: 0 }
}, { timestamps: true });

module.exports = mongoose.model('Product', productSchema);